package com.smfx.yxt.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.smfx.yxt.daoSqlserver.WorkApprovalConfMapper;
import com.smfx.yxt.model.WorkApprovalConf;
import com.smfx.yxt.page.Page;
import com.smfx.yxt.service.IWorkApprovalConfService;

@Service("workApprovalConfService")
public class WorkApprovalConfServiceImpl implements IWorkApprovalConfService {

	@Autowired
	private WorkApprovalConfMapper workApprovalConfMapper;
	
	@Override
	public int addAndUpdate(WorkApprovalConf record) {
		if(record.getId() == null) {
			return workApprovalConfMapper.insertSelective(record);
		}
		record.setUpdateTime(new Date());
		return workApprovalConfMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public List<WorkApprovalConf> selectListByPage(Page<WorkApprovalConf> page) {
		return workApprovalConfMapper.selectListByPage(page);
	}

	@Override
	public WorkApprovalConf selectByParam(WorkApprovalConf record) {
		return workApprovalConfMapper.selectByParam(record);
	}

}
